<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="/admin/lib/html5shiv.js"></script>
<script type="text/javascript" src="/admin/lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="/admin/lib/laypage/1.2/skin/laypage.css" />
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="/admin/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="/admin/static/h-ui.admin/css/style.css" />

<script type="text/javascript" src="/admin/lib/vue/vue.min.js"></script>
<script type="text/javascript" src="/admin/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="/admin/lib/layer/2.4/layer.js" charset="utf-8"></script>
<script type="text/javascript" src="/admin/static/h-ui/js/H-ui.min.js"></script> 
<script type="text/javascript" src="/admin/static/h-ui.admin/js/H-ui.admin.js"></script>

<!--[if IE 6]>
<script type="text/javascript" src="/admin/lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>借款管理</title>
</head>
<body>



	<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 借款管理<span class="c-gray en">&gt;</span> 部门经理审批<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	<div class="text-c"> 日期范围：
		<input type="text" onfocus="WdatePicker({ maxDate:'#F{$dp.$D(\'datemax\')||\'%y-%M-%d\'}' })" placeholder="输入申请日期" id="datemin" name="startDate" class="input-text Wdate" style="width:120px;">
		-
		<input type="text" onfocus="WdatePicker({ minDate:'#F{$dp.$D(\'datemin\')}',maxDate:'%y-%M-%d' })" placeholder="输入申请日期" id="datemax" name="endDate" class="input-text Wdate" style="width:120px;">
		<input type="text" class="input-text" style="width:250px" placeholder="输入申请中，审核通过，审核未通过" id="subState" name="subState">
		<i class="Hui-iconfont">&#xe665;</i><input type="button" value="搜借款申请" class="btn btn-success radius" id="selectByDynamic" name="selectByDynamic">
	</div>
	<div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="r">共有数据：<strong id="totalnum"></strong>条</span> </div>
	<div id="app" class="mt-20">
	<table class="table table-border table-bordered table-hover table-bg table-sort">
		<thead>
			<tr class="text-c">
				<th width="80">ID</th>
				<th width="120">申请日期</th>
				<th width="120">使用日期</th>
				<th width="200">申请主体</th>
				<th width="200">申请金额</th>
				<th width="200">部门</th>
				<th width="">是否完成审批</th>
				<th width="120">是否提交</th>
				<th width="200">操作</th>
			</tr>
		</thead>
		<tbody>
			<tr class="active" v-for="(item,index) in result">
				<td>{{index+1}}</td>
				<td>{{item.applyDate}}</td>
					<td>{{item.useDate}}</td>
					<td>{{item.applyTitle}}</td>
					<td>{{item.applyMoney}}</td>
					<td>{{item.oaDept.deptName}}</td>
					<td>{{item.oaSubmit.submitState}}</td>
					<td>{{item.applySubmit}}</td>
			        <td class="td-manage"><a style="text-decoration:none" @click="lookApply(item.applyId)" href="javascript:;" title="查看"><i class="Hui-iconfont">&#xe725;</i></a> <a title="审批" id="findApply" href="javascript:;" @click="editEvent(item.applyId,item.oaSubmit.submitState)" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a></td>
			</tr>
			<tr>
				<td colspan="10" align="right"><div id="pagenav"></div></td>
			</tr>
		</tbody>
	</table>
	</div>
</div>





<!--_footer 作为公共模版分离出去-->

<!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<!--日历插件-->
<script type="text/javascript" src="/admin/lib/My97DatePicker/4.8/WdatePicker.js"></script> 
<!--从单前数据检索
<script type="text/javascript" src="/admin/lib/datatables/1.10.0/jquery.dataTables.min.js"></script> -->
<!--分页插件-->
<script type="text/javascript" src="/admin/lib/laypage/1.2/laypage.js" charset="utf-8"></script>
<script type="text/javascript">

	var app = new Vue({
		el:'#app',
		data:{
			result:[]
		}
	});
	//查询用户数据
	var getUserPageList = function(curr) {
		$.ajax({
			type : "GET",
			dataType : "json",
			url : "/applyMoney/getPages",
			data : {
				pageNum:curr || 1,
				pageSize:5,
				startDate:$("#datemin").val(),
				endDate:$("#datemax").val(),
				subState:$("#subState").val(),
			
			},

			success : function(msg) {
				app.result=msg.page;
				$("#totalnum").html(msg.num1);
				laypage({
				  cont: 'pagenav', //容器。值支持id名、原生dom对象，jquery对象,
				  totol: msg.total,//总条数
				  pages : msg.totalPage, //总页数
				  skip: true, //是否开启跳页
				  skin: '#AF0000',
				  groups: 3,//连续显示分页数
				  curr : curr || 1, //当前页
		 		  jump: function(obj, first){ //触发分页后的回调
			  	  if(!first){ //点击跳页触发函数自身，并传递当前页：obj.curr
				         getUserPageList(obj.curr);
			        }
			      }							  
				});
			},
		});
	}
	//渲染分页
getUserPageList();
	
//查看用户申请
var lookApply = function(id) {
		layer.open({
			type : 2,
			title : '编辑用户',
			fix : false,
			maxmin : true,
			shadeClose : true,
			area : [ '1100px', '600px' ],
			content : '/applyMoney/lookBorrowMoney?applyId='+id,
			end : function() {
				getUserPageList();
			}
		});
}
	
	
//审核用户申请
var editEvent = function(id,submitState) {
	if(submitState=="申请中"){
		layer.open({
			type : 2,
			title : '编辑用户',
			fix : false,
			maxmin : true,
			shadeClose : true,
			area : [ '1100px', '600px' ],
			content : '/applyMoney/checkBorrowMoney?applyId='+id,
			end : function() {
				
				getUserPageList();
			}
		});
	}else{
		layer.msg('已审核，不能重复审核' ,{icon:5});
	}
	
}

//多条件查询
$('#selectByDynamic').on('click', function(){
	getUserPageList();
});



</script> 
</body>
</html>